package no.ntnu.idi.deid.preprocessor.postagger;

import java.io.File;

import no.ntnu.idi.deid.config.FilePaths;

public class POStagger {

	private POStagger() {

	}

	public static void tagFolder(File input, File output) {
		if (input.isDirectory() && output.isDirectory()) {
			try {
				Runtime r = Runtime.getRuntime();
				Process p = r.exec("python " + FilePaths.getPosTaggerPath()
						+ " -i " + input.getPath() 
						+ " -o " + output.getPath());
				p.waitFor();
			} catch (Exception e) {
				String cause = e.getMessage();
				if (cause.equals("python: not found"))
					System.err.println("No python interpreter found.");
			}
		}
	}
	
	public static void tagFolder(String input, String output) {
		tagFolder(new File(input), new File(output));
	}
}
